喜马拉雅[听].js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. var rule = {
  2. 类型: '听书',
  3. title: '喜马拉雅[听]',
  4. host: 'https://m.ximalaya.com',
  5. url: '/m-revision/page/category/queryCategoryAlbumsByPage?sort=0&pageSize=50&page=fypage&categoryCode=fyclass',
  6. searchUrl: 'https://www.ximalaya.com/revision/search/main?core=album&page=1&rows=20&kw=**',
  7. searchable: 2,
  8. quickSearch: 0,
  9. timeout: 5000,
  10. class_name: '有声书&儿童&音乐&相声&娱乐&广播剧&历史&外语',
  11. class_url: 'youshengshu&ertong&yinyue&xiangsheng&yule&guangbojv&lishi&waiyu',
  12. play_parse: true,
  13. lazy: $js.toString(() => {
  14. input = {url: input, parse: 0}
  15. }),
  16. double: true,
  17. 一级: $js.toString(() => {
  18. let d = [];
  19. let html = request(input);
  20. let data = JSON.parse(html).data.albumBriefDetailInfos;
  21. data.forEach(it => {
  22. let id = 'https://mobile.ximalaya.com/mobile/v1/album/track/ts-1720589105807?albumId=' + it.id + '&pageId=1&pageSize=3000&device=android&isAsc=true';
  23. d.push({
  24. url: id,
  25. title: it.albumInfo.title,
  26. img: 'http://imagev2.xmcdn.com/' + it.albumInfo.cover,
  27. })
  28. });
  29. setResult(d);
  30. }),
  31. 二级: $js.toString(() => {
  32. let urls = [];
  33. let html = request(input);
  34. let json = JSON.parse(html);
  35. // log(html);
  36. let data = json.data.list;
  37. data.forEach(it => {
  38. urls.push(it.title + '$' + it.playPathAacv164);
  39. });
  40. let maxPageId = json.data.maxPageId;
  41. if (typeof (batchFetch) === 'function' && maxPageId > 1) {
  42. let reqUrls = [];
  43. for (let j = 2; j <= maxPageId; j++) {
  44. reqUrls.push({url: input.replace('pageId=1', 'pageId=' + j), option: {timeout: 5000}});
  45. }
  46. let rhtmls = batchFetch(reqUrls);
  47. rhtmls.forEach((rhtml) => {
  48. let rjson = JSON.parse(rhtml);
  49. let rdata = rjson.data.list;
  50. rdata.forEach(it => {
  51. urls.push(it.title + '$' + it.playPathAacv164);
  52. });
  53. });
  54. }
  55. VOD = {
  56. vod_play_from: '球球啦',
  57. vod_play_url: urls.join('#')
  58. };
  59. }),
  60. 搜索: $js.toString(() => {
  61. let d = [];
  62. let html = request(input);
  63. let data = JSON.parse(html).data.album.docs;
  64. data.forEach(it => {
  65. let id = 'https://mobile.ximalaya.com/mobile/v1/album/track/ts-1720589105807?albumId=' + it.albumId + '&pageId=1&pageSize=3000&device=android&isAsc=true';
  66. d.push({
  67. url: id,
  68. title: it.title,
  69. img: it.coverPath,
  70. })
  71. });
  72. setResult(d);
  73. }),
  74. }